<template>
  <div >
    <div class="container" moduelTitle :style="{'cursor': path ? 'pointer': 'auto', ...bgStyle}" @click="toNext">
        <p class="title">{{title}} </p><p class="tooltipbox" v-if="titlePopshow" @mouseenter="isshow=!isshow"></p>

    </div>
    <div class="popbox" @mouseleave="isshow=false" v-if="isshow&&titlePopshow" :style="{'left':leftP+'%','top':topP+'px'}">
      <h2 @click="isshow=false">说明</h2>
      <div class="popcontent">
        <h3>{{ tableData.title }}				</h3>
        <div class="wrap-column-box" >
          <div class="wrap-table head" >
            <table style="width:100%;border-spacing: 0">
              <colgroup>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 50%"/>
              </colgroup>
              <thead>
              <tr>
                <th>指标分类</th>
                <th>指标名称</th>
                <th>分类权重</th>
                <th>指标权重</th>
                <th>基准值</th>
                <th>计分规则</th>
              </tr>
              </thead>
            </table>
          </div>
          <div class="wrap-table body" style="height:400px; overflow: auto">
            <table style="width:100%;border-spacing: 2px">
              <colgroup>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 10%"/>
                <col style="width: 50%"/>
              </colgroup>
              <tr v-for="(item,index) in tableData.value" :key="index">
<!--                <td>{{ index < 9 ? '0' + (index + 1) : index + 1 }}</td>-->
                <td>{{ item.type }}</td>
                <td>{{ item.name }}</td>
                <td>{{ item.flqz }}</td>
                <td>{{item.zbqz}}</td>
                <td>{{item.jzz}}</td>
                <td><p>{{item.jfgz}}</p></td>
              </tr>

            </table>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      isshow:false
    }
   },
    props: {
        title: String,
        path: String,
        noBg: Boolean,
        titlePopshow:Boolean,
        tableData:Object,
        leftP:String,
        topP:String
    },
    computed: {
        bgStyle() {
            if (this.noBg) return {'background-image': 'none'}
            return  {}
        }
    },
    methods:{
        toNext() {
            if (!this.path)return;
            this.$router.push(this.path)
        }
    }
}
</script>
<style lang="less" scoped>
body{
  position: relative;
}
.container[moduelTitle] {
    font-family: FZDBSJW--GB1-0;
    font-size: 24px;
    cursor: pointer;
    color: #FFFFFF;
    letter-spacing: 1.44px;
    text-align: center;
    height: 40px;
    line-height: 42px;
    font-weight: 400;
    background-image: linear-gradient(269deg, rgba(0,178,255,0.00) 0%, rgba(8,132,255,0.24) 51%, rgba(0,178,255,0.00) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}
.title {
    position: relative;
    &::before {
        content: " ";
        position: absolute;
        top: 30%;
        left: -32px;
        width: 24px;
        height: 16px;
        background-image: url('../assets/title-arrow-left.svg');
    }
    &::after {
        content: " ";
        position: absolute;
        top: 30%;
        right: -32px;
        width: 24px;
        height: 16px;
        background-image: url('../assets/title-arrow-right.svg');
    }
}
.tooltipbox{
  width:40px;
  height:40px;
  margin-left: 60px;
  background:url("../assets/tooltip.svg") no-repeat center;
  cursor: pointer;
}
.popbox{
  width:800px;
  height:600px;
  margin-right:150px;
  position: absolute;
  left:100px;
  top:10%;
  background-color: #01182A;
  background-image: url("../assets/lefttop.svg"),url("../assets/righttop.svg"),url("../assets/leftbottom.svg"),url("../assets/rightbottom.svg"),;
  background-repeat: no-repeat,no-repeat,no-repeat,no-repeat;
  background-position: left top,right top,left bottom,right bottom;
  border: 1px solid rgba(35,81,184,1);
  z-index: 9999999;
  .popcontent{
    padding:20px;
    overflow: hidden;
    z-index: 9999999;
    h3{
      text-align: left;
      font-size:18px;
      font-weight: bold;
    }
    p{
      line-height: 24px;
      margin:0;
      padding-left:10px;
      font-size:16px;
      color:#fff;
      text-align: left;

    }
  }

}
.popbox h2{
  width:100%;
  height:40px;
  line-height: 40px;
  font-size: 18px;
  margin:0;
  padding:0;
  background-image: linear-gradient(269deg, rgba(0,178,255,0.00) 0%, rgba(8,132,255,0.24) 51%, rgba(0,178,255,0.00) 100%);
  position: relative;
  &:after{
    content: 'X';
    width:32px;
    height:32px;
    color:#fff;
    font-size:16px;
    position: absolute;
    right:10px;
    top:0;
    cursor: pointer;
  }
}
.wrap-column-box{
  margin-top:20px;
  margin-bottom:20px;
}
.wrap-table table{
  width:100%;
  border-spacing:0
}
.wrap-table.body tr{
  border-spacing:5px;
  margin-bottom:2px;
}
.wrap-table.head tr th{
  height:40px;
  line-height: 40px;
  text-align: center;
  font-size: 16px;
  color: #fff;
  background: rgba(8,132,255,.2)
}

.wrap-table.body tr td {
  font-size: 16px;
  padding: 5px 0;
  color: rgba(255,255,255,0.72);
  text-align: center;
  background: rgba(8,132,255,.12);
  line-height:20px;
}
.wrap-table.body tr td p{
  //width: 160px;
  //white-space: nowrap;
  //overflow: hidden;
  //text-overflow: ellipsis;
}
</style>
